package com.itheima.wallet.api;

import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.wallet.common.domain.Account;

public interface AccountService extends IService<Account> {

    /**
     * 开户，创建一个新的账户
     * @param account
     * @return
     */
    Boolean insertAccount(Account account);

    /**
     * 根据Token 查询用户信息
     * @param token
     * @return
     */
    Account queryAccount(String token);

    /**
     * 增加余额
     *
     * @param account
     * @param money
     * @return
     */
    Boolean addBalance(Account account, Double money);

    /**
     * 减少余额
     *
     * @param account
     * @param money
     * @return
     */
    Boolean reduceBalance(Account account, Double money);
}
